using UniversalAdminSystem.Application.FileStorage.Interfaces;

namespace UniversalAdminSystem.Infrastructure.FileStorage.Parsers;

public class DocParserFactory
{
    public IDocParser GetParser(string mimeType)
    {
        return mimeType.ToLower() switch
        {
            "application/pdf" => new PdfParseService(),
            "text/markdown" => new MdParseService(),
            "text/plain" => new TxtParseService(),
            _ => throw new NotImplementedException($"没有为 MIME 类型 '{mimeType}' 实现解析器")
        };
    }
}